<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <script src="http://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
</head>
<body>
<form id="myForm">
    <input type="text" id="pwdInput" name="pwd"> <input
        type="text" id="usernameInput" name="username"> <input
        type="button" id="submitBtn" value="提交">
</form>
<script>
    $('#submitBtn').on('click', function () {
        $.post('${base}/admin/test/add.jhtml', $('#myForm').serialize(), function (data) {
            console.info(data);
            if (!data.success) {
                return;
            }
            alert("添加成功")
        }, 'json');
    })
</script>
</body>
</html>